package cn.gzmli.dtt.common.controll;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("dtt")
public class MainController {


    @RequestMapping("/main")
    @ResponseBody
    public ModelAndView hello(HttpServletRequest request, ModelAndView mv) {
        String url = request.getParameter("url");
        mv.setViewName(url);
        /* String basePath = request.getScheme() + "://"
                + request.getServerName() + ":" + request.getServerPort()
                + request.getContextPath();
         request.getSession().setAttribute("basePath",basePath);*/
        return mv;

    }

}
